<script setup lang="ts">
import { request } from './utils/request'
// import { Button as VanButton, Checkbox as VanCheckBox } from 'vant'
import useStore from './stores/index'
import type { UserType } from './types/user'
const { user } = useStore()
const fn = () => {
  request<UserType>('/login/password', 'post', {
    mobile: '13211112222',
    password: 'abc12345'
  }).then((res) => {
    user.setUser(res.data)
    console.log('跳转')
  })
}
const getInfo = async () => {
  const res = await request('patient/myUser')
  console.log(res)
}
</script>
<template>
  <div>
    <button @click="fn">测试</button>
    <button @click="getInfo">获取用户信息</button>
    app {{ user.user }}
    <van-button type="primary">主要按钮</van-button>
    <van-checkbox></van-checkbox>
    <van-cell-group inset>
      <!-- <van-field v-model="value" label="文本" placeholder="请输入用户名" /> -->
    </van-cell-group>
    <button
      @click="
        user.setUser({
          token: '1',
          refreshToken: '1',
          avatar: '1',
          mobile: '1',
          account: '1',
          id: '1'
        })
      "
    >
      设置个人信息
    </button>
    <button @click="user.delUser">清除</button>
    <div class="box">123</div>
  </div>
</template>

<style lang="scss" scoped>
.box {
  width: 100px;
  height: 100px;
  border: 1px solid #000;
  color: var(--wcg);
}
</style>
